home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_cyn_copterarrival.cog < prev    next >
Text File  |  1999-11-15  |  10KB  |  346 lines

  1. # Jones 3D Cog Script
  2. #
  3. # CYN_Coptor_Arrival.cog
  4. #
  5. # the helicoptor with sophia arrives upon picking up the clay shard
  6. #
  7. # [CMG & revised by HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. symbols
  13.  
  14. # .................................. MESSAGES ..................................
  15.  
  16.     message        startup
  17.     message        entered
  18.  
  19. # .................................. KEYFRAMES .................................
  20.                
  21.     keyframe    in_examine=0in_examobj_1_1.key        local # 117x   
  22.     keyframe    in_lookup=0in_stand7.key               local
  23.     keyframe    in_takeit=in_activate_low.key       local # 83x
  24.     keyframe    in_wheregoodstuff=0in_crownsofkings_1_1.key    local # 144x
  25.  
  26.     keyframe    chopFly=cyn_chopr_fly.key            local
  27.  
  28. # .................................. MODELS ....................................
  29.     
  30.     model        chop_blad=cyn_chopr_blade.3do        local
  31.     model        chop_rot=cyn_chopr_rotor.3do        local
  32.     model        shardhand=hand_in_potshard.3do        local
  33.     
  34. # .................................. SOUNDS ....................................
  35.  
  36.     sound        in_funnyspot=Cn01j02.wav            local    # funny how I didn't spot this...
  37.     sound        in_ifprize=Cn01j03.wav                local    # if this is the prize...
  38.     sound        in_artifacts=Cn01j04.wav            local    # where are the...artifacts?
  39.     sound        in_goodnews=Cn01j05.wav                local    # Good news never travels...fast
  40.     
  41.     sound        helirun=helicopter_rev2.wav            local
  42.     sound        scene_start=mus_gen_awechord2.wav    local
  43. # ............................... ACTOR THINGS .................................
  44.  
  45.     thing        player                                local
  46.     thing        indyActor                            nolink
  47.     thing        helicopter                            nolink        
  48.     thing        bird1                                        
  49.     thing        bird2                                        
  50.     
  51. # .............................. OBJECT THINGS .................................
  52.  
  53.     thing        shard                                nolink        
  54.     thing        ruins                                nolink
  55.     thing        rope_1                                nolink
  56.     thing        rope_2                                nolink
  57.     thing        campsite_helicopter                    nolink
  58.  
  59. # .............................. CAMERA THINGS .................................
  60.  
  61.     thing        cam_11                                nolink
  62.     thing        cam_12                                nolink
  63.     thing        cam_13                                nolink
  64.     thing        cam_14                                nolink
  65.     thing        cam_15                                nolink
  66.     thing        cam_16                                nolink
  67.     thing        cam_17                                nolink
  68.     
  69.     thing        ct_11                                nolink
  70.     thing        ct_12                                nolink
  71.     thing        ct_13                                nolink
  72.     thing        ct_14                                nolink
  73.     thing        ct_15                                nolink
  74.  
  75. # .............................. TARGET THINGS .................................
  76.  
  77.     thing        in_mk_11                            nolink
  78.     thing        in_mk_12                            nolink
  79.     thing        in_mk_13                            nolink
  80.         
  81.     thing        copt_LookTarget1                    nolink
  82.     thing        copt_LookTarget2                    nolink
  83.     thing        copt_LookTarget3                    nolink
  84.     
  85.     thing        copt_Target1                        nolink
  86.     thing        copt_Target2                        nolink
  87.     
  88. # ........................ OTHER ENGINE REFERENCES .............................
  89.  
  90. #    surface        shardsurf
  91.     surface        startsurf                            linkID=2
  92.     surface        startsurf0                            linkID=2
  93.     surface        startsurf1                            linkID=2
  94.  
  95. # ............................... VARIABLES ....................................
  96.  
  97.     int            cutSceneState=0                        local
  98.     
  99.     int            in_keyTrack                            local
  100.     
  101.     int            copterSound                            local
  102.     
  103.     int            in_swapref                            local
  104.     
  105.     int            ru_colltype                            local
  106.     int            r1_colltype                            local
  107.     int            r2_colltype                            local
  108.     
  109.     int            curcam                                local
  110.     int            cursound                            local
  111.  
  112. end
  113.  
  114. # ==============================================================================
  115.  
  116. code
  117.  
  118. #...............................................................................
  119.  
  120. startup:
  121.  
  122.     player = GetLocalPlayerThing();
  123.     SetThingFlags(helicopter, 0x80000);
  124.     ru_colltype = GetCollideType(ruins);
  125.     r1_colltype = GetCollideType(rope_1);
  126.     r2_colltype = GetCollideType(rope_2);
  127.  
  128.     return;
  129.  
  130. #...............................................................................              
  131.  
  132. entered:
  133.  
  134.     if (cutSceneState != 0) return;
  135.     
  136.     if (GetSenderID() != 2) return;
  137.  
  138.     # Prep...
  139.     cutSceneState = 1;
  140.     curcam = GetCurrentCamera();
  141.  
  142.     # Disable controls, stop player and put away weapon
  143.     if(MakeMeStop() == -1) return;
  144.     DeselectWeaponWait(player);
  145.     StartCutscene(1); # fade
  146.     
  147.     # Set up actor
  148.     CopyPlayerHolsters(player, indyActor);
  149.     SetThingFlags(player, 0x80000);
  150.     ClearThingFlags(indyActor, 0x80000);
  151.     SetThingFlags(indyActor, 0x10); # present but invisible
  152.     TeleportThing(indyActor, in_mk_11);
  153.     AISetCutSceneMode(indyActor);
  154.     SetThingMaxRotVel(indyActor, 80.0);
  155.  
  156.     # hide the birds (avoid copter / bird mayhem)
  157.     SetThingFlags(bird1, 0x10);
  158.     SetThingFlags(bird2, 0x10);
  159.  
  160.     # Cut to down angle on Indy walking from pool to shard...
  161.     SetCameraLookInterp(2, 0);
  162.     SetCameraPosInterp(2, 0);
  163.     SetCameraFocus(2, cam_11);
  164.     SetCameraSecondaryFocus(2, ct_11);
  165.     SetCurrentCamera(2);
  166.     SetCameraFOV(90, 0, 0.0);
  167.     ClearThingFlags(indyActor, 0x10); # now see him
  168.     Sleep(0.01);
  169.     SetCameraInterpSpeed(2, 4.5);
  170.     SetCameraLookInterp(2, 1);
  171.     SetCameraPosInterp(2, 1);
  172.     Sleep(0.01);
  173.     SetCameraFocus(2, cam_12);
  174.     SetCameraSecondaryfocus(2, ct_12);
  175.     SetCameraFOV(70, 1, 4.5);
  176.  
  177.     # play the scene music
  178.     PlaySoundLocal(scene_start, 1.0, 0.0, 0x0, 0);
  179.  
  180.  
  181.     # Move Indy to the potsherd...
  182.     AISetMoveSpeed(indyActor, 0.8);
  183.     AISetLookThing(indyActor, in_mk_12);
  184.     AISetMoveThing(indyActor, in_mk_12, 0);
  185.     Sleep(2.0);
  186.     AIEnableHeadTracking(indyActor, shard);
  187.     AIWaitForStop(indyActor);
  188.  
  189.     # Indy: "Funny how I didn't spot this before..."
  190.     PlayVoice(player, in_funnyspot, 2, 0);
  191.     PlayKey(indyActor, in_takeit, 4, 0x12, 0);
  192.     Sleep(0.9);
  193.     
  194.     # Get rid of the shard...
  195.     DestroyThing(shard);
  196.     in_swapref = SetThingMesh(indyActor, 15, shardhand, 0);
  197.     Sleep(1.0);
  198.     AIEnableHeadTracking(indyActor, in_mk_13);
  199.     Sleep(0.5);
  200.  
  201.     # Indy: "If this is the prize, I'll lose my grant for sure."
  202.     cursound = PlayVoice(indyActor, in_ifprize, 2, 0);
  203.     PlayKey(indyActor, in_examine, 4, 0x12, 0); # 3.9 sec
  204.     WaitForSound(cursound);
  205.     Sleep(0.5);
  206.  
  207.        # Cut to shot of indy...
  208.     SetCameraInterpSpeed(2, 2.0);
  209.     SetCameraFocus(2, cam_13);
  210.     SetCameraSecondaryFocus(2, ct_13);
  211.     SetCameraFOV(60, 1, 2.0);
  212.     
  213.     # Indy: "where are the priceless artifacts...gilded idols...crowns of kings?"
  214.     PlayKey(indyActor, in_wheregoodstuff, 4, 0x12 ,0);
  215.     cursound = PlayVoice(indyActor, in_artifacts, 2, 0); # 4.83 sec
  216.     #WaitForSound(cursound);
  217.     Sleep(4.0);
  218.     copterSound = PlaySoundLocal(helirun, 0.0, 0.0, 0x1, 0);
  219.     
  220.     ChangeSoundVol(copterSound, 1.0, 4.0);
  221.     Sleep(1.0);
  222.     
  223.     # Reveal the helicopter offscreen...
  224.     ClearThingFlags(helicopter, 0x80000);
  225.     AISetCutSceneMode(helicopter);
  226.      PlayKey(helicopter, chopFly, 4, 0x10, 0);
  227.    
  228.     # The blades blur...
  229.     SetThingMesh(helicopter, 3, chop_blad, 0); # main rotor
  230.     SetThingMesh(helicopter, 1, chop_rot, 0); # tail rotor
  231.     
  232.     # Indy looks at the copter...
  233.     AISetLookThing(indyActor, helicopter);
  234.     AIEnableHeadTracking(indyActor, helicopter);
  235.     Sleep(0.5);
  236.     
  237.     # Pan up to the helicopter...
  238.     SetCollideType(ruins, 0); # camera should not bump anything
  239.     SetCollideType(rope_1, 0);
  240.     SetCollideType(rope_2, 0);
  241.     SetCameraInterpSpeed(2, 3.0);
  242.     SetCameraFocus(2, cam_14);
  243.     SetCameraSecondaryFocus(2, ct_14);
  244.     SetCameraFOV(45, 1, 3.0);
  245.  
  246.     # Enter the helicopter...
  247.     SetThingMaxRotVel(helicopter, 20.0); # make it slow to turn (was 20.0)
  248.     AIEnableBodyTracking(helicopter, copt_LookTarget1);
  249.     AISetMoveSpeed(helicopter, 2.5);
  250.     AISetMoveThing(helicopter, copt_Target1, 0);
  251.     Sleep(1.5);
  252.     AISetMoveSpeed(helicopter, 1.5);
  253.     Sleep(1.0);
  254.     AISetMoveSpeed(helicopter, 1.0);
  255.     SetThingMaxRotVel(helicopter, 15.0); # was 15.0
  256.     Sleep(0.5);
  257.  
  258.     # Wobble copter around...
  259.     AISetMoveSpeed(helicopter, 0.5);
  260.     SetThingMaxRotVel(helicopter, 10.0); # was 10.0
  261.     #Sleep(0.5);
  262.     AIEnableBodyTracking(helicopter, copt_LookTarget2);
  263.     Sleep(0.75);
  264.     
  265.     # Stabilize the camera...
  266.     SetCameraLookInterp(2, 0);
  267.     SetCameraPosInterp(2, 0);        
  268.          
  269.     # Helicopter heads for campsite...
  270.     AIDisableBodyTracking(helicopter);
  271.     AISetLookThing(helicopter, copt_LookTarget3);
  272.     AttachThingToThing(ct_14, helicopter);
  273.     Sleep(0.5);
  274.     SetThingMaxRotVel(helicopter, 25.0); # was 25.0
  275.     AISetMoveSpeed(helicopter, 1.0);
  276.     AISetMoveThing(helicopter, copt_Target2, 0);
  277.     SetCameraFOV(65, 1, 3.0);
  278.     Sleep(0.5);
  279.     AISetMoveSpeed(helicopter, 1.5);
  280.     Sleep(1.0);
  281.     AISetMoveSpeed(helicopter, 2.0);
  282.     
  283.     # Aim Indy toward campsite offscreen...
  284.     RestoreThingMesh(indyActor, in_swapref); # drop that shard
  285.     AISetLookThing(indyActor, copt_Target2);
  286.     in_keyTrack = PlayKey(indyActor, in_lookup, 4, 0x14 ,0);
  287.     AIDisableHeadTracking(indyActor);
  288.     Sleep(3.0);
  289.  
  290.     StopSound(copterSound, 5.0);
  291.     Sleep(2.0);
  292.  
  293.     # pitch-shift the copterSound for doppler effect
  294.     ChangeSoundPitch(copterSound, 0.5, 4.0);
  295.     Sleep(1.0);
  296.  
  297.     # Cut to down shot on Indy...
  298.     SetCameraFocus(2, cam_15);
  299.     SetCameraSecondaryFocus(2, ct_15);
  300.     SetCameraFOV(55, 0, 0.0);
  301.     Sleep(0.01);
  302.     SetCameraInterpSpeed(2, 3.1);
  303.     SetCameraLookInterp(2, 1);
  304.     SetCameraPosInterp(2, 1);
  305.     Sleep(0.01);
  306.     SetCameraFocus(2, cam_16);
  307.     SetCameraFOV(45, 1, 3.1);
  308.  
  309.     # restore the birds
  310.     ClearThingFlags(bird1, 0x10);
  311.     ClearThingFlags(bird2, 0x10);
  312.  
  313.     # Indy: "Good news never travels that fast.  Better get up there."
  314.     cursound = PlayVoice(indyActor, in_goodnews, 2, 0); # 3.2 sec
  315.     Sleep(0.5);
  316.     StopKey(indyActor, in_keyTrack, 0.5);
  317.     WaitForSound(cursound);
  318.     Sleep(0.3);
  319.  
  320.     # Clean up and restore player control...
  321.     SetCameraLookInterp(2, 0);
  322.     SetCameraPosInterp(2, 0);
  323.     TeleportThing(player, indyactor);
  324.     SetThingFlags(indyActor, 0x80000);
  325.     ClearThingFlags(player, 0x80000);
  326.  
  327.     SetCameraPosition(1, GetThingPos(cam_17));
  328.     SetCurrentCamera(curcam);
  329.  
  330.     SetThingAlpha(player, 1);
  331.  
  332.     DestroyThing(helicopter);
  333.     SetCollideType(ruins, ru_colltype);
  334.      SetCollideType(rope_1, r1_colltype);
  335.     SetCollideType(rope_2, r2_colltype);
  336.  
  337.     EndCutScene();
  338.     ClearActorFlags(player, 0x200000);
  339.  
  340.     # Now the helicopter is up at the campsite...
  341.     ClearThingFlags(campsite_helicopter, 0x80000);
  342.  
  343.     return;
  344.  
  345. end
  346.